package com.studio5704website.api.security;

import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 高威
 * 用于Spring Security重写权限规则
 */
@Service
@Component("accessService")
public interface AccessService {
    /**
     * @param request http请求
     * @param auth Spring Security内置 Authentication(请求接口的用户)
     * @return 有无权限
     */
    boolean hasPermit(HttpServletRequest request, Authentication auth);
}
